﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FourKill.Engine
{
    public class Camera : Placement, ICamera
    {

        public void Attach(IMovementObservable obj)
        {
            obj.Moved += new EventHandler<MovementArgs>(obj_Moved);
        }

        public void Detach(IMovementObservable obj)
        {
            obj.Moved -= new EventHandler<MovementArgs>(obj_Moved);
        }

        void obj_Moved(object sender, MovementArgs e)
        {
            this.X = e.Placement.X;
            this.Y = e.Placement.Y;
            this.Z = e.Placement.Z;
            this.Bearing = e.Placement.Bearing;
            this.TotalMovement = e.Placement.TotalMovement;
        }
    }
}
